import request from '@/utils/request'

export function getExterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}
// 楼宇列表
export function getBuildingAPI(params) {
  return request({
    url: '/park/building',
    params
  })
}
// * 获取行业列表
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}
// 上传合同
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}
// 提交
export function createExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}
// 获取合同详情
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}
// 更新企业
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// /**
//  * 删除企业
//  * @param {*} id
//  * @returns
//  */
export function delExterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}
// 获取合同列表
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}
/** 企业
 * 获取楼宇列表
 * @param {*} id
 * @returns
 */
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}
/**
 * 创建合同
 * @param {*}
 * @returns
 */
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}
/**
 * 退租
 * @param {合同id} rentId
 * @returns
 */

export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}

// ---------------------------------------------------------------------------------------------------
/**
 * 添加楼宇
 * @param {*} data
 * @returns
 */
export function createBuildingListAPI(data) {
  return request({
    url: '/park/building',
    method: 'POST',
    data
  })
}
// // 删除获取楼宇
export function delBuildingListAPI(id) {
  return request({
    url: `/park/building/${id}`,
    method: 'DELETE'
  })
}
// 修改楼宇
export function modificationAPI(data) {
  return request({
    url: '/park/building',
    method: 'PUT',
    data
  })
}
// 获取楼宇详情
export function xiangQingAPI(id) {
  return request({
    url: `/park/building/${id}`
  })
}
